package com.bailan.mapper;

import com.bailan.pojo.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author BaiLan
 * @since 2022:05:24
 */
@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    @Select("Select T_name from teacher where T_id=#{id} ")
    String getTeacherName(String id);



    @Select("Select A_name from admin where A_id=#{id}")
    String getAdminName(String id);

    @Select("SELECT\n" +
            "C_id\n" +
            "FROM student\n" +
            "WHERE S_id=#{studentId}")
    String getStudentClassId(String studentId);


    @Select("SELECT\n" +
            "C_id \n" +
            "FROM class\n" +
            "WHERE T_id=#{teacherId}")
    List<String> getTeacherClassId(String teacherId);
}
